<?php

namespace app\sysuser\controller\organization;

use app\common\controller\SysBackend;
use app\common\model\banxi\organization\OrganizationLevelRw as OrganizationLevelRwModel;
use think\db\exception\DbException;

/**
 * 机构
 */
class OrganizationLevelRw extends SysBackend
{
    protected array $noNeedLogin = [];

    protected array $noNeedPermission = ['*'];

    public function initialize(): void
    {
        parent::initialize();
        $this->model = new OrganizationLevelRwModel();
    }

    /**
     * 分页查询
     * @return void
     * @throws DbException
     */
    public function listPage(): void
    {
        $param = $this->request->param(['index', 'limit', 'orderBy', "query"]);
        //查询条件解析
        $where = get_query($param);
        //获取分页数据
        $pageParams = get_page_params($param);
        $list = $this->model->getListPage($where, $pageParams['page'], $pageParams['limit']);
        $this->ok('操作成功', result_row($list));
    }
}